package com.vitabuybuy.tv.network

import com.library.common.net.NetUrl
import com.vitabuybuy.tv.dto.NoticeDetailDto
import com.vitabuybuy.tv.dto.TaskManageListDto
import rxhttp.IAwait
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toResponse

/**
 * 作者：SimGa
 * 日期：2021/3/19
 * 时间：16:29
 * 包名：com.vitabuybuy.tv.network
 */

object NoticeRepository {


    fun getNoticeList(
        params: Map<String, Any>
    ): IAwait<MutableList<TaskManageListDto>> {
        return RxHttp.postJson(NetUrl.api_notice_list).addAll(params).toResponse()
    }


    fun getNoticeDetails(
        id: Int?
    ): IAwait<NoticeDetailDto> {
        return RxHttp.postJson(NetUrl.api_notice_detail).add("id",id).toResponse()
    }


    fun applyAuth(
        params: Map<String, Any?>
    ): IAwait<String> {
        return RxHttp.postJson(NetUrl.api_apply_auth).addAll(params).toResponse()
    }
    fun comfirmReceiver(
        params: Map<String, Any?>
    ): IAwait<String> {
        return RxHttp.postJson(NetUrl.api_comfirm_receiver).addAll(params).toResponse()
    }
}